package com.utils;

import java.util.UUID;

/**
 * UUIDUtil.java
 *
 * @author Liang 649355204@qq.com
 * CreateTime 2019/7/22 8:41
 */
public class UUIDUtil {
    /**
     * 获取指定数量的uuid
     * */
    public static String[] getUUID(int num){
        if (num < 1){
            return null;
        }
        String[] rtn = new String[num];
        for(int i=0;i<num;i++){
            rtn[i] = getUUID();
        }
        return rtn;
    }

    /**
     * 获取一个uuid
     * */
    public static String getUUID(){
        String uuid = UUID.randomUUID().toString();
        return uuid.replaceAll("-", "");
    }
}
